//用户接口相关的函数
import request from '../utils/requset'

//登录
export const checkLogin = (data) => {
    return request.post('/users/checkLogin', data)
}

//添加账号
export const userAdd = (data) => {
    return request.post('/users/add', data)
}

//账号列表
export const userList = (params) => {
    return request.get('/users/list', { params })
}

//编辑账号信息
export const userEdit = (data) => {
    return request.post('/users/edit', data)
}

//删除账号
export const userDel = (params) => {
    return request.get('/users/del', { params })
}

//批量删除
export const batchdel = (data) => {
    return request.post('/users/batchdel', data)
}

//获取个人信息
export const userInfo = () => {
    return request.get('/users/info')
}

//检查旧密码是否正确
export const checkOldpwd = (params) => {
    return request.get('/users/checkoldpwd', { params })
}

//修改密码
export const userEditpwd = (data) => {
    return request.post('/users/editpwd', data)
}

//修改个人头像
export const avatarEdit = (params) => {
    return request.get('/users/avataredit', { params })
}